package com.sdx.console.video.service;

import java.util.List;

import com.ibeetl.admin.core.dao.CoreDictDao;
import com.ibeetl.admin.core.entity.CoreDict;
import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.video.dao.ConsultVideoDao;
import com.sdx.console.video.entity.ConsultVideo;
import com.ibeetl.admin.core.service.BaseService;

/**
 * 咨询视频 Service
 */

@Service
@Transactional
public class ConsultVideoService extends BaseService<ConsultVideo>{

    @Resource
	private ConsultVideoDao consultVideoDao;

    @Resource
    private CoreDictDao dictDao;

    public PageQuery<ConsultVideo>queryByCondition(PageQuery query){
        PageQuery ret =  consultVideoDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelConsultVideo(List<String> ids){
        try {
            consultVideoDao.batchDelConsultVideoByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除咨询视频失败", e);
        }
    }

	public List<ConsultVideo> all() {
		return consultVideoDao.all();
		}

    public List<CoreDict> querViodeTypes(){
        return dictDao.findAllList("VIDEO_TYPE");
    }
}